package org.eae.eldf.dao.base.impl;

import java.util.ArrayList;
import java.util.List;

import org.eae.eldf.dao.base.IBaseLovDao;
import org.eae.eldf.entity.base.BaseLov;
import org.eae.eldf.framework.dao.JdbcDaoImpl;
import org.eae.eldf.framework.pager.Pagination;
import org.springframework.stereotype.Repository;

/******************************************************************************
 * @File name   :      BaseLovDaoImpl.java
 *
 * @Author      :      xl
 *
 * @Date        :      2016-6-7
 *
 * @Copyright Notice: 
 * Copyright (c) 2016 Efast Serv. All  Rights Reserved.
 * This software is published under the terms of the Efast Software
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 * 
 * 
 * ----------------------------------------------------------------------------
 * Date                   Who         Version        Comments
 * 2016-6-7 上午10:34:29        xl     1.0            Initial Version
 *****************************************************************************/
@Repository
public class BaseLovDaoImpl extends JdbcDaoImpl implements IBaseLovDao{

	/**
	 * {@inheritDoc} 
	 * overridden:
	 * @Date        :      2016-6-7
	 * @see org.eae.eldf.dao.base.IBaseLovDao#getBaseLovListById(java.lang.Long)
	**/
	@Override
	public Pagination<BaseLov> getBaseLovListById(Pagination<BaseLov> pager,Long baseLovId) {
		// TODO Auto-generated method stub
		List<Object> params=new ArrayList<Object>();
		StringBuffer sql =new StringBuffer("select * from base_lov ");
		if(null!=baseLovId){
			sql.append(" where parent_id=?");
			params.add(baseLovId);
		}
		return this.queryListByPage(pager,sql.toString(), params, BaseLov.class);
	}


	

}
